import request from '@/utils/request'

// 查询班级培养方案中间表列表
export function listClassTrainingLink(query) {
  return request({
    url: '/college/classTrainingLink/list',
    method: 'get',
    params: query
  })
}

// 查询班级培养方案中间表详细
export function getClassTrainingLink(id) {
  return request({
    url: '/college/classTrainingLink/' + id,
    method: 'get'
  })
}

// 新增班级培养方案中间表
export function addClassTrainingLink(data) {
  return request({
    url: '/college/classTrainingLink',
    method: 'post',
    data: data
  })
}
export function batchAddClassTrainingLink(data) {
  return request({
    url: '/college/classTrainingLink/batch', // 批量插入接口
    method: 'post',
    data: data
  });
}
// 修改班级培养方案中间表
export function updateClassTrainingLink(data) {
  return request({
    url: '/college/classTrainingLink',
    method: 'put',
    data: data
  })
}

// 删除班级培养方案中间表
export function delClassTrainingLink(id) {
  return request({
    url: '/college/classTrainingLink/' + id,
    method: 'delete'
  })
}
// api/college/classTrainingLink.js
// 根据行政班ID获取培养方案ID列表（简化版）
export function getTrainingProgramIdsByClassId(classId) {
  return request({
    url: '/college/classTrainingLink/ids', // 假设后端提供此接口
    method: 'get',
    params: { administrativeClassId: classId }
  });
}
// 新增：批量删除关联记录
export function deleteClassTrainingLinksByClassId(classId) {
  return request({
    url: `/college/classTrainingLink/batch/delete`,
    method: 'delete',
    params: { administrativeClassId: classId }
  })
}
